using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Domain.Entities;
using Domain.UserManagenent;
using Services;

namespace Logic.UserManagement
{
    public class UserExporter:IExporter
    {
        public Stream Export(IEnumerable<IEntity> users)
        {
            var serialiser = new XmlSerializer(typeof(List<User>));
            var outputStream = new MemoryStream();
            serialiser.Serialize(new StreamWriter(outputStream), users);
            outputStream.Position = 0;
            return outputStream;
        }
    }
}